<template>
  <div id="app">
    <h3>用户登录</h3>
    <form>
      用户名：<input type="text" v-model="myForm.username" /><br>
      密码：<input type="password" v-model="myForm.password" /><br>
      <input type="button" value="登录" @click="login" />
    </form>
  </div>
</template>

<script>
export default {
  name: "LoginView",
  data() {
    return{
      myForm: {
        username:'',
        password:''
      }
    }
  },
  methods:{
     login() {
       if(this.myForm.username==='123'&&this.myForm.password==='123'){
         this.$store.commit('changeLogin',true)
         this.$router.push("/dl")
         setTimeout(() => {
           this.$router.push("/RouterIndex")
         },3000)
       }else {
         alert("用户名密码错误")
       }
     }
  }
}
</script>

<style scoped>

</style>